package cn.itcast.user.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 客户端接口，框架会根据当前接口创建代理对象，通过代理对象远程调用订单微服务
 */

//order表示要调用的微服务的名称
//fallback对应的是熔断器处理类，当调用的order服务不可以时会执行此类
@FeignClient(value="order",fallback = OrderClientHystrix.class)
public interface OrderClient {
    @RequestMapping(value="/order/{id}",method = RequestMethod.GET)
    public String findById(@PathVariable("id") String id);
}